import * as TYPE from './type';
import {toGet, toPost, toDel, toPut} from '../../utils/MyAxios';
import {Notice} from 'iview';

/*获取文件列表*/
export const getNoticeList = ({commit}) => {
  toGet('/notice-information/notice/Unread/'+localStorage.getItem('userId'))
    .then((response) => {
      if (response.resultCode === 0) {
        let responseData=response.data;
        commit(TYPE.NOTICELIST, {
          work_list:responseData.work,
          hr_list:responseData.hr,
          daily_list:responseData.daily,
          finance_list:responseData.finance,
        });
      }
      else {
        Notice.error({
          title: '获取通告信息列表失败',
          desc: response.resultMsg
        });
      }
    });
};
